home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / Developer Essentials Jul 90 / Programming / MPW Interfaces & Libraries 3.1 / PInterfaces / Controls.p < prev    next >
Encoding:
Text File  |  1989-10-13  |  4.7 KB  |  184 lines  |  [TEXT/MPS ]

  1. {
  2. Created: Thursday, April 6, 1989 at 7:49 PM
  3.     Controls.p
  4.     Pascal Interface to the Macintosh Libraries
  5.  
  6.     Copyright Apple Computer, Inc. 1985-1988
  7.     All rights reserved
  8. }
  9.  
  10.  
  11. {$IFC UNDEFINED UsingIncludes}
  12. {$SETC UsingIncludes := 0}
  13. {$ENDC}
  14.  
  15. {$IFC NOT UsingIncludes}
  16.     UNIT Controls;
  17.     INTERFACE
  18. {$ENDC}
  19.  
  20. {$IFC UNDEFINED UsingControls}
  21. {$SETC UsingControls := 1}
  22.  
  23. {$I+}
  24. {$SETC ControlsIncludes := UsingIncludes}
  25. {$SETC UsingIncludes := 1}
  26. {$IFC UNDEFINED UsingQuickdraw}
  27. {$I $$Shell(PInterfaces)Quickdraw.p}
  28. {$ENDC}
  29. {$SETC UsingIncludes := ControlsIncludes}
  30.  
  31. CONST
  32. pushButProc = 0;
  33. checkBoxProc = 1;
  34. radioButProc = 2;
  35. useWFont = 8;
  36. scrollBarProc = 16;
  37. inButton = 10;
  38. inCheckBox = 11;
  39. inUpButton = 20;
  40. inDownButton = 21;
  41. inPageUp = 22;
  42. inPageDown = 23;
  43. inThumb = 129;
  44.  
  45. {
  46. axis constraints for DragGrayRgn call }
  47.  
  48. noConstraint = 0;
  49. hAxisOnly = 1;
  50. vAxisOnly = 2;
  51.  
  52. {
  53. control messages }
  54.  
  55. drawCntl = 0;
  56. testCntl = 1;
  57. calcCRgns = 2;
  58. initCntl = 3;
  59. dispCntl = 4;
  60. posCntl = 5;
  61. thumbCntl = 6;
  62. dragCntl = 7;
  63. autoTrack = 8;
  64. cFrameColor = 0;
  65. cBodyColor = 1;
  66. cTextColor = 2;
  67. cThumbColor = 3;
  68.  
  69.  
  70. TYPE
  71.  
  72. ControlPtr = ^ControlRecord;
  73. ControlHandle = ^ControlPtr;
  74. ControlRecord = PACKED RECORD
  75.     nextControl: ControlHandle;
  76.     contrlOwner: WindowPtr;
  77.     contrlRect: Rect;
  78.     contrlVis: Byte;
  79.     contrlHilite: Byte;
  80.     contrlValue: INTEGER;
  81.     contrlMin: INTEGER;
  82.     contrlMax: INTEGER;
  83.     contrlDefProc: Handle;
  84.     contrlData: Handle;
  85.     contrlAction: ProcPtr;
  86.     contrlRfCon: LONGINT;
  87.     contrlTitle: Str255;
  88.     END;
  89.  
  90. CCTabPtr = ^CtlCTab;
  91. CCTabHandle = ^CCTabPtr;
  92. CtlCTab = RECORD
  93.     ccSeed: LONGINT;            {reserved}
  94.     ccRider: INTEGER;            {see what you have done - reserved}
  95.     ctSize: INTEGER;            {usually 3 for controls}
  96.     ctTable: ARRAY [0..3] OF ColorSpec;
  97.     END;
  98.  
  99. AuxCtlPtr = ^AuxCtlRec;
  100. AuxCtlHandle = ^AuxCtlPtr;
  101. AuxCtlRec = RECORD
  102.     acNext: AuxCtlHandle;        {handle to next AuxCtlRec}
  103.     acOwner: ControlHandle;     {handle for aux record's control}
  104.     acCTable: CCTabHandle;        {color table for this control}
  105.     acFlags: INTEGER;            {misc flag byte}
  106.     acReserved: LONGINT;        {reserved for use by Apple}
  107.     acRefCon: LONGINT;            {for use by application}
  108.     END;
  109.  
  110.  
  111.  
  112. FUNCTION NewControl(theWindow: WindowPtr;boundsRect: Rect;title: Str255;
  113.     visible: BOOLEAN;value: INTEGER;min: INTEGER;max: INTEGER;procID: INTEGER;
  114.     refCon: LONGINT): ControlHandle;
  115.     INLINE $A954;
  116. PROCEDURE SetCTitle(theControl: ControlHandle;title: Str255);
  117.     INLINE $A95F;
  118. PROCEDURE GetCTitle(theControl: ControlHandle;VAR title: Str255);
  119.     INLINE $A95E;
  120. FUNCTION GetNewControl(controlID: INTEGER;owner: WindowPtr): ControlHandle;
  121.     INLINE $A9BE;
  122. PROCEDURE DisposeControl(theControl: ControlHandle);
  123.     INLINE $A955;
  124. PROCEDURE KillControls(theWindow: WindowPtr);
  125.     INLINE $A956;
  126. PROCEDURE HideControl(theControl: ControlHandle);
  127.     INLINE $A958;
  128. PROCEDURE ShowControl(theControl: ControlHandle);
  129.     INLINE $A957;
  130. PROCEDURE DrawControls(theWindow: WindowPtr);
  131.     INLINE $A969;
  132. PROCEDURE Draw1Control(theControl: ControlHandle);
  133.     INLINE $A96D;
  134. PROCEDURE HiliteControl(theControl: ControlHandle;hiliteState: INTEGER);
  135.     INLINE $A95D;
  136. PROCEDURE UpdtControl(theWindow: WindowPtr;updateRgn: RgnHandle);
  137.     INLINE $A953;
  138. PROCEDURE MoveControl(theControl: ControlHandle;h: INTEGER;v: INTEGER);
  139.     INLINE $A959;
  140. PROCEDURE SizeControl(theControl: ControlHandle;w: INTEGER;h: INTEGER);
  141.     INLINE $A95C;
  142. PROCEDURE SetCtlValue(theControl: ControlHandle;theValue: INTEGER);
  143.     INLINE $A963;
  144. FUNCTION GetCtlValue(theControl: ControlHandle): INTEGER;
  145.     INLINE $A960;
  146. PROCEDURE SetCtlMin(theControl: ControlHandle;minValue: INTEGER);
  147.     INLINE $A964;
  148. FUNCTION GetCtlMin(theControl: ControlHandle): INTEGER;
  149.     INLINE $A961;
  150. PROCEDURE SetCtlMax(theControl: ControlHandle;maxValue: INTEGER);
  151.     INLINE $A965;
  152. FUNCTION GetCtlMax(theControl: ControlHandle): INTEGER;
  153.     INLINE $A962;
  154. PROCEDURE SetCRefCon(theControl: ControlHandle;data: LONGINT);
  155.     INLINE $A95B;
  156. FUNCTION GetCRefCon(theControl: ControlHandle): LONGINT;
  157.     INLINE $A95A;
  158. PROCEDURE SetCtlAction(theControl: ControlHandle;actionProc: ProcPtr);
  159.     INLINE $A96B;
  160. FUNCTION GetCtlAction(theControl: ControlHandle): ProcPtr;
  161.     INLINE $A96A;
  162. PROCEDURE DragControl(theControl: ControlHandle;startPt: Point;limitRect: Rect;
  163.     slopRect: Rect;axis: INTEGER);
  164.     INLINE $A967;
  165. FUNCTION TestControl(theControl: ControlHandle;thePt: Point): INTEGER;
  166.     INLINE $A966;
  167. FUNCTION TrackControl(theControl: ControlHandle;thePoint: Point;actionProc: ProcPtr): INTEGER;
  168.     INLINE $A968;
  169. FUNCTION FindControl(thePoint: Point;theWindow: WindowPtr;VAR theControl: ControlHandle): INTEGER;
  170.     INLINE $A96C;
  171. PROCEDURE SetCtlColor(theControl: ControlHandle;newColorTable: CCTabHandle);
  172.     INLINE $AA43;
  173. FUNCTION GetAuxCtl(theControl: ControlHandle;VAR acHndl: AuxCtlHandle): BOOLEAN;
  174.     INLINE $AA44;
  175. FUNCTION GetCVariant(theControl: ControlHandle): INTEGER;
  176.     INLINE $A809;
  177.  
  178. {$ENDC}    { UsingControls }
  179.  
  180. {$IFC NOT UsingIncludes}
  181.     END.
  182. {$ENDC}
  183.  
  184.